﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:edc="clr-namespace:Microsoft.Expression.Controls;assembly=Microsoft.Expression.Drawing" xmlns:em="clr-namespace:Microsoft.Expression.Media;assembly=Microsoft.Expression.Drawing" 
    x:Class="MyDeeWeibo.PageViews.UserProfile"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    Loaded="PhoneApplicationPage_Loaded"
    shell:SystemTray.IsVisible="True"
    xmlns:ImageTools="clr-namespace:ImageTools.Controls;assembly=ImageTools.Controls"
    DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <phone:PhoneApplicationPage.Resources>
        <ImageTools:ImageConverter x:Key="ImageConverter"/>
    	<ControlTemplate x:Key="FollowButtonControlTemplate" TargetType="Button">
    		<Grid HorizontalAlignment="Center" Width="133">
    			<Grid.Background>
                    <ImageBrush Stretch="Uniform" ImageSource="{Binding following_img}"/>
    			</Grid.Background>
    		</Grid>
    	</ControlTemplate>
    	<DataTemplate x:Key="ProfileTemplateComplex">
    		<Grid Margin="0,15,8,15" Width="424" Height="500">
    			<Grid.RowDefinitions>
    				<RowDefinition Height="Auto" />
    				<RowDefinition Height="Auto" />
    				<RowDefinition Height="Auto" />
    			</Grid.RowDefinitions>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="Auto" />
    				<ColumnDefinition Width="*"/>
    			</Grid.ColumnDefinitions>
    			<Grid x:Name="HeadGrid" Margin="0" Width="424">
    				<StackPanel x:Name="ProfileImg" Orientation="Vertical" d:LayoutOverrides="GridBox" Margin="0,-8,0,8" HorizontalAlignment="Left" Grid.RowSpan="2" Width="160" Height="160">
    					<Border x:Name="ProfileBorder" BorderThickness="1" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="{StaticResource TransparentBrush}" Width="160" Height="160">
    						<Canvas Margin="0">
    							<Image x:Name="ProfileImage" Source="{Binding avatar_large}" Height="152" Width="152" Canvas.Left="3" Canvas.Top="3"/>
    							<Image x:Name="VerifyLogo" Height="30" Width="30" Canvas.Left="135" Canvas.Top="135" Source="/Resources/Images/SinaResource.Verifier.png" Visibility="{Binding IsVerified}" Stretch="UniformToFill"/>
    						</Canvas>
    					</Border>
    				</StackPanel>
    				<Grid x:Name="Title" UseLayoutRounding="True" Height="40" VerticalAlignment="Top" Margin="175,0,0,0" Grid.Column="1" Grid.ColumnSpan="2">
    					<Grid.ColumnDefinitions>
    						<ColumnDefinition Width="*"/>
    						<ColumnDefinition Width="Auto"/>
    						<ColumnDefinition Width="Auto"/>
    					</Grid.ColumnDefinitions>
    					<TextBlock x:Name="UserName" Margin="0" FontSize="24" Text="{Binding name}" Padding="10,0" Foreground="Black" LineHeight="16" Height="40" />
    				</Grid>
    				<Image Width="24" Height="24" Source="{Binding gender_img}" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Height" Margin="175,60,0,0"/>
    				<TextBlock Text="{Binding location}" Height="24" Margin="207,57,0,0" FontFamily="Segoe WP" Foreground="Black" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Height" />
    				<StackPanel Margin="175,100,49,0" Orientation="Horizontal" Height="24" Width="200" VerticalAlignment="Top">
    					<Image Width="24" Height="24" Source="{Binding isOnline_img}"/>
    					<TextBlock Text="{Binding isOnline}" Height="24" Margin="8,-3,0,0" FontFamily="Segoe WP" Foreground="Black" />
    				</StackPanel>
    			</Grid>

    			<StackPanel x:Name="Content" Grid.Row="1" Margin="0" Orientation="Vertical" d:LayoutOverrides="Height" Grid.ColumnSpan="2" >
    				<Grid Width="160" d:LayoutOverrides="GridBox" HorizontalAlignment="Left" Height="100" Margin="4,5,0,0">
    					<StackPanel Margin="0" Grid.Row="1" Height="33" Orientation="Horizontal" Width="160" VerticalAlignment="Top">
    						<TextBlock HorizontalAlignment="Left" Height="33" TextWrapping="Wrap" Text="关注：" Width="60" Foreground="Black" FontSize="20"/>
    						<TextBlock Height="33" Text="{Binding friends_count}" Foreground="Black" FontSize="20"/>
    					</StackPanel>
    					<StackPanel Margin="0" VerticalAlignment="Center" Height="33" Orientation="Horizontal" Width="160">
    						<TextBlock HorizontalAlignment="Left" Height="33" TextWrapping="Wrap" Text="粉丝：" Width="60" Foreground="Black" FontSize="20"/>
    						<TextBlock Height="33" Text="{Binding followers_count}" Foreground="Black" FontSize="20"/>
    					</StackPanel>
    					<StackPanel Height="33" Margin="0,0,0,1" VerticalAlignment="Bottom" Grid.Row="2" Orientation="Horizontal" Width="160">
    						<TextBlock HorizontalAlignment="Left" Height="33" TextWrapping="Wrap" Text="微博：" Width="60" Foreground="Black" FontSize="20"/>
    						<TextBlock Height="33" Text="{Binding statuses_count}" Foreground="Black" FontSize="20"/>
    					</StackPanel>
    					<Button Content="followButton" Margin="235,34,-208,32" BorderBrush="{StaticResource TransparentBrush}" 
                                Template="{StaticResource FollowButtonControlTemplate}" 
                                Height="34" IsEnabled="{Binding following_btn}" Width="133"
                                Click="followButton_Click" Visibility="{Binding following_vis}">
    						<Button.Foreground>
    							<ImageBrush Stretch="Fill"/>
    						</Button.Foreground>
    					</Button>
    				</Grid>
    			</StackPanel>
    			<StackPanel x:Name="FootGrid" Margin="4,30,0,-80" Grid.Row="3" VerticalAlignment="Bottom">
    				<TextBlock Text="简介" TextWrapping="Wrap" FontSize="20" Foreground="Black" Margin="0" />
    				<edc:Callout AnchorPoint="-0.1,0" Content="{Binding description}" Fill="#FFF4F4F5" FontSize="20" Height="170" Margin="0,10,0,0" Stroke="{StaticResource GreyBrush}" Width="299" HorizontalAlignment="Center"/>
    			</StackPanel>
    		</Grid>
    	</DataTemplate>
    	<DataTemplate x:Key="StatusTemplateComplex">
    		<Grid Margin="0,12,8,10">
    			<Grid.RowDefinitions>
    				<RowDefinition Height="Auto" />
    				<RowDefinition Height="Auto" />
    				<RowDefinition Height="Auto" />
    			</Grid.RowDefinitions>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="Auto" />
    				<ColumnDefinition Width="*"/>
    			</Grid.ColumnDefinitions>
    			<StackPanel x:Name="LeftPanel" Orientation="Vertical" d:LayoutOverrides="Height" Margin="0,0,8,0">
    				<Border x:Name="ProfileBorder" BorderThickness="1" Width="64" Height="64" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="{StaticResource TransparentBrush}">
    					<Canvas Margin="0">
                            <Image x:Name="ProfileImage" Source="{Binding user.profile_img}" Height="56" Width="56" Canvas.Left="2" Canvas.Top="2"/>
    						<Image x:Name="VerifyLogo" Height="20" Width="20" Canvas.Left="45" Canvas.Top="45" Source="/Resources/Images/SinaResource.Verifier.png" Visibility="{Binding user.IsVerified}" Stretch="UniformToFill"/>
    					</Canvas>
    				</Border>
    			</StackPanel>

    			<StackPanel x:Name="RightPanel" Grid.Column="1" Grid.Row="0" Margin="0" Orientation="Vertical" d:LayoutOverrides="Height" >
    				<Grid x:Name="HeaderGrid" Margin="0,0,0,10" UseLayoutRounding="True" Height="30">
                        <Grid.Background>
                            <LinearGradientBrush EndPoint="0.5,0" MappingMode="RelativeToBoundingBox" StartPoint="0.5,1">
                                <GradientStop Color="{Binding Source={StaticResource AppSettings}, Path=colorSaved}" Offset="0"/>
                                <GradientStop Color="Transparent" Offset="0.1"/>
                            </LinearGradientBrush>
                        </Grid.Background>
                        <Grid.ColumnDefinitions>
    						<ColumnDefinition Width="*"/>
    						<ColumnDefinition Width="Auto"/>
    						<ColumnDefinition Width="Auto"/>
    					</Grid.ColumnDefinitions>
    					<TextBlock x:Name="UserName" Height="30" Margin="-10" FontSize="20" Text="{Binding user.name}" Padding="10,0" Foreground="Black" LineHeight="16" />
    					<TextBlock x:Name="CreateTimeBlock" Text="{Binding CreatedAt}" FontSize="20" VerticalAlignment="Bottom" Grid.Column="1" Foreground="{StaticResource GreyBrush}" Margin="0" Height="30"/>
    				</Grid>
    				<TextBlock x:Name="StatusBlock" Text="{Binding text}" TextWrapping="Wrap" FontSize="21.333" Foreground="Black" />
                    <ImageTools:AnimatedImage x:Name="GifShow" Source="{Binding thumbnail_isgif, Converter={StaticResource ImageConverter}}" HorizontalAlignment="Left" Stretch="Uniform" Visibility="{Binding IsThumbnail}" Margin="0,12,0,0" VerticalAlignment="Top" Height="{Binding thumbnail_isgifheight}"/>
                    <Image x:Name="ThumbImage" Source="{Binding thumbnail_pic}" HorizontalAlignment="Left" Stretch="Uniform" Visibility="{Binding IsThumbnail}" Margin="0,12,0,0" VerticalAlignment="Top" Height="{Binding thumbnail_notgifheight}"/>
    				<Border x:Name="RetweetBorder" Margin="0,12,0,0" Padding="8,12" Visibility="{Binding IsRetweetedStatus}" CornerRadius="10" BorderThickness="1" Background="#FFEDEDED" BorderBrush="#FFC2C2C2">
    					<StackPanel>
    						<TextBlock x:Name="RetweetUserBlock" TextWrapping="Wrap" Text="{Binding retweeted_status.user.name}" Margin="0,0,0,10" Foreground="Black" FontWeight="Bold"/>
    						<TextBlock x:Name="RetweetStatusBlock" TextWrapping="Wrap" Text="{Binding retweeted_status.text}" Foreground="Black"/>
                            <ImageTools:AnimatedImage x:Name="RetweetGifShow" 
                                                      Source="{Binding retweeted_status.thumbnail_isgif, Converter={StaticResource ImageConverter}}" 
                                                      HorizontalAlignment="Left" Stretch="Uniform" Visibility="{Binding retweeted_status.IsThumbnail}" 
                                                      Margin="0,12,0,0" VerticalAlignment="Top" Height="{Binding retweeted_status.thumbnail_isgifheight}"/>
                            <Image x:Name="RetweetThumbImage" 
                                   Margin="0,12,0,0" 
                                   Stretch="Uniform" 
                                   Source="{Binding retweeted_status.thumbnail_pic}" 
                                   Visibility="{Binding retweeted_status.IsThumbnail}" 
                                   HorizontalAlignment="Left" 
                                   VerticalAlignment="Top" 
                                   Height="{Binding retweeted_status.thumbnail_notgifheight}"/>
    					</StackPanel>
    				</Border>
    			</StackPanel>

    			<Grid x:Name="FooterGrid" Margin="0,12,0,0" Grid.Row="1" Grid.Column="1">
    				<Grid.ColumnDefinitions>
    					<ColumnDefinition Width="Auto"/>
    					<ColumnDefinition/>
    				</Grid.ColumnDefinitions>
    				<StackPanel x:Name="SourcePanel" Orientation="Horizontal" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment, GridBox">
    					<Image x:Name="StatusPicHint" Source="/Resources/Images/Status_Pic.png" Visibility="{Binding IsThumbnail}" Margin="0,0,0,-2" Width="30"/>
    					<TextBlock x:Name="SourceBlock"
    						Text="{Binding Source}" 
    						d:LayoutOverrides="Width" 
    						HorizontalAlignment="Left" 
    						VerticalAlignment="Bottom" 
    						FontSize="18.667" Foreground="{StaticResource GreyBrush}"/>
    					<Image x:Name="StatusComment" Source="/Resources/Images/Status_Comment.png" Margin="0,0,0,-2" Width="30"/>
    					<TextBlock x:Name="CommentCount"
    						Text="{Binding comments_count}" 
    						d:LayoutOverrides="Width" 
    						HorizontalAlignment="Left" 
    						VerticalAlignment="Bottom" 
    						FontSize="18.667" Foreground="{StaticResource GreyBrush}"/>
    					<Image x:Name="StatusRepost" Source="/Resources/Images/Status_Repost.png" Margin="0,0,0,-2" Width="30"/>
    					<TextBlock x:Name="RepostCount"
    						Text="{Binding reposts_count}" 
    						d:LayoutOverrides="Width" 
    						HorizontalAlignment="Left" 
    						VerticalAlignment="Bottom" 
    						FontSize="18.667" Foreground="{StaticResource GreyBrush}"/>
    				</StackPanel>
    			</Grid>

    			<Path x:Name="Separater" Data="M0,80 L448,80" Height="1" Margin="0" Grid.Row="2" Grid.ColumnSpan="2" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Top" HorizontalAlignment="Center">
    				<Path.Stroke>
                        <SolidColorBrush Color="#FFEDEFF5"/>
    				</Path.Stroke>
    			</Path>
    		</Grid>
    	</DataTemplate>
        <DataTemplate x:Key="FollowTemplateComplex">
            <Grid Margin="0,12,8,10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <Grid Margin="0,0,8,0" d:LayoutOverrides="Height">
                	<Border x:Name="ProfileBorder" BorderThickness="1" Width="64" Height="64" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="{StaticResource TransparentBrush}">
                		<Canvas Margin="0">
                			<Image x:Name="ProfileImage" Source="{Binding profile_img}" Height="56" Width="56" Canvas.Left="2" Canvas.Top="2"/>
                			<Image x:Name="VerifyLogo" Height="20" Width="20" Canvas.Left="45" Canvas.Top="45" Source="/Resources/Images/SinaResource.Verifier.png" Visibility="{Binding IsVerified}" Stretch="UniformToFill"/>
                		</Canvas>
                	</Border>
                	<Canvas HorizontalAlignment="Right" Height="24" Margin="0,24,-40,0" Width="24" d:LayoutOverrides="VerticalAlignment">
                        <Image Width="24" Height="24" Source="{Binding gender_img}"/>
                	</Canvas>
                	<StackPanel Margin="108,0,-369,0" Width="321" d:LayoutOverrides="GridBox" Height="56" VerticalAlignment="Top" Grid.Column="2">
                        <TextBlock HorizontalAlignment="Left" Height="24" TextWrapping="Wrap" Text="{Binding screen_name}" VerticalAlignment="Top" Margin="-30,0,0,0" Foreground="Black"/>
                        <TextBlock HorizontalAlignment="Left" Height="24" TextWrapping="Wrap" Text="{Binding location}" VerticalAlignment="Bottom" Margin="0,5,0,0" Foreground="Black"/>
                	</StackPanel>
            	</Grid>

            	<Path x:Name="Separater" Data="M0,80 L448,80" Height="1" Margin="0" Grid.Row="2" Grid.ColumnSpan="2" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Top" HorizontalAlignment="Center">
            		<Path.Stroke>
                        <SolidColorBrush Color="White"/>
            		</Path.Stroke>
            	</Path>
            </Grid>
        </DataTemplate>
        <Style x:Key="CustomScrollViewerStyle" TargetType="ScrollViewer">
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
            <Setter Property="Padding" Value="4"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ScrollViewer">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
                            <Grid Background="{TemplateBinding Background}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <ScrollContentPresenter x:Name="ScrollContentPresenter" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}"/>
                                <Rectangle Grid.Column="1" Fill="#FFE9EEF4" Grid.Row="1"/>
                                <ScrollBar x:Name="VerticalScrollBar" Grid.Column="1" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Margin="0,-1,-1,-1" Minimum="0" Orientation="Vertical" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{TemplateBinding VerticalOffset}" ViewportSize="{TemplateBinding ViewportHeight}" Width="5" Background="{StaticResource GreyBrush}" Opacity="0.3"/>
                                <ScrollBar x:Name="HorizontalScrollBar" Grid.Column="0" Height="18" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Margin="-1,0,-1,-1" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{TemplateBinding HorizontalOffset}" ViewportSize="{TemplateBinding ViewportWidth}"/>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <ControlTemplate x:Key="ListBoxControlTemplate" TargetType="ListBox" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
            <ScrollViewer x:Name="ScrollViewer" BorderBrush="{TemplateBinding BorderBrush}" 
                          BorderThickness="{TemplateBinding BorderThickness}" 
                          Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" Padding="{TemplateBinding Padding}" 
                          Style="{StaticResource CustomScrollViewerStyle}" 
                          ManipulationCompleted="ListBox_ManipulationCompleted">
                <ItemsPresenter/>
            </ScrollViewer>
        </ControlTemplate>
    </phone:PhoneApplicationPage.Resources>
    
	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
 
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="UserSettings" IsEnabled="True" Text="设置" Click="UserSettings_Click"/>
            </shell:ApplicationBar.MenuItems>
            <shell:ApplicationBarIconButton x:Name="refreshIconButton" IconUri="/Resources/Icons/appbar_refresh.png" Text="刷新" Click="refreshIconButton_Click"/>
            <shell:ApplicationBarIconButton x:Name="atUserButton" IconUri="/Resources/Icons/appbar_mention.png" Text="@TA" Click="atUserButton_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
    
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Style="{StaticResource BackgroundStyle}">
<!--TitlePanel contains the name of the application and page title
		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
			<TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppName}" Style="{StaticResource PhoneTextNormalStyle}" Foreground="{StaticResource PhoneBackgroundBrush}"/>
			<TextBlock x:Name="PageTitle" Text="Timeline" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Foreground="{StaticResource PhoneBackgroundBrush}"/>
		</StackPanel>->

		ContentPanel - place additional content here-->
        <Grid.RowDefinitions>
        	<RowDefinition Height="Auto"/>
        	<RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <controls:Pivot x:Name ="ProfilePivot" Title="{StaticResource AppName}" 
                        Foreground="{Binding Source={StaticResource AppSettings}, Path=colorSaved}" 
                        SelectionChanged="ProfilePivot_SelectionChanged" >
            <!--Pivot1-->
            <controls:PivotItem x:Name="profile" Header="资料" Foreground="Black" Margin="12,0">
                <Grid x:Name="ProfilePanel" Grid.Row="1" Margin="12,0" Height="531" >
                    <ListBox x:Name="userProfile"
                     ItemsSource="{Binding UserProfileShow}" 
                     ItemTemplate="{StaticResource ProfileTemplateComplex}" Foreground="Black" 
                     Margin="0,1,0,0" Height="530" HorizontalAlignment="Right" Width="432"/>
                </Grid>
            </controls:PivotItem>

            <!--Pivot2-->
            <controls:PivotItem x:Name="weibo" Header="微博" Foreground="Black" Margin="12,0" >
                <Grid x:Name="WeiboPanel" Grid.Row="1" Margin="12,0" Height="531">
                    <ListBox x:Name="userWeibo"
                     ItemsSource="{Binding UserTimelineList}" 
                     ItemTemplate="{StaticResource StatusTemplateComplex}" Foreground="Black" 
                     Margin="0,1,0,0" Height="530" HorizontalAlignment="Right" Width="432"
                     SelectionChanged="userWeibo_SelectionChanged" Template="{StaticResource ListBoxControlTemplate}"/>
                </Grid>
            </controls:PivotItem>

            <!--Pivot3-->
            <controls:PivotItem x:Name="following" Header="关注" Foreground="Black" Margin="12,0" >
                <Grid x:Name="followingPanel" Grid.Row="1" Margin="12,0" Height="531">
                    <ListBox x:Name="followings"
                     ItemsSource="{Binding FriendshipFollowing}" 
                     ItemTemplate="{StaticResource FollowTemplateComplex}" Foreground="Black" 
                     Margin="0,1,0,0" Height="530" HorizontalAlignment="Right" Width="432"
                     SelectionChanged="followings_SelectionChanged" Template="{StaticResource ListBoxControlTemplate}"/>
                </Grid>
            </controls:PivotItem>

            <!--Pivot4-->
            <controls:PivotItem x:Name="followrd" Header="粉丝" Foreground="Black" Margin="12,0" >
                <Grid x:Name="followedPanel" Grid.Row="1" Margin="12,0" Height="531">
                    <ListBox x:Name="followers"
                     ItemsSource="{Binding FriendshipFollower}" 
                     ItemTemplate="{StaticResource FollowTemplateComplex}" Foreground="Black" 
                     Margin="0,1,0,0" Height="530" HorizontalAlignment="Right" Width="432"
                     SelectionChanged="followers_SelectionChanged" Template="{StaticResource ListBoxControlTemplate}"/>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>

    </Grid>

</phone:PhoneApplicationPage>
